# -- coding: utf-8 -- 
# Name: app

from flask import Flask,request,Response
app = Flask(__name__)
@app.route('/')
def set_cookie():
    req = Response("Please set your cookie!")
    req.set_cookie("username",'zhangsan',max_age=7200)
    return req
@app.route('/get_cookie')
def get_cookie():
    if request.cookies.get('username'):
        username = request.cookies.get('username')
    else:
        username = 'cookie is None'
    return username
@app.route('/del_cookie')
def delete_cookie():
    req = Response("Delete cookie")
    req.set_cookie('username')
    return req

if __name__ == '__main__':
    app.run(debug=True)
